home *** CD-ROM | disk | FTP | other *** search
- Path: news.citenet.net!g34-85
- From: kabir@citenet.net (larry mintz)
- Newsgroups: comp.lang.c
- Subject: Re: How do I read a random I/O file into a structure ?
- Date: Thu, 21 Mar 96 22:27:01 GMT
- Organization: CiteNet Telecom - Commercial Internet Service
- Message-ID: <4isl5t$guk@cti01.citenet.net>
- References: <4iskkm$guk@cti01.citenet.net>
- NNTP-Posting-Host: g34-85.citenet.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
-
- I have the following data in a file called log.dat.It represents the login/out
- times of people on a network: The fields are
- NAME LOGIN_TIME LOGOUT_TIME PORT
- with the following data:
- kthomas 3:30:45 4:00:00 23
- urstupid 5:12:12 67
- iamsmart 12:34:11 13:23:11 90
- kthomas 14:23:11 15:12:45 23
- urstupid 5:30:12 6:00:00 25
-
- The structure I am using is
- struct xx{ char NAME[10];
- char LOGIN_TIME[10];
- char LOGOUT_TIME[10];
- unsigned PORT:5;
- };
- struct xx LOGTABLE[10];
-
- Question: How do I load log.dat into the struct LOGTABLE[10] so all the data
- is in the proper fields?
- kabir.
-